import React from "react";
import { routerRedux } from 'dva/router';
import {connect} from "dva";
import {Tabs, Flex, List, WhiteSpace, WingBlank, Icon, Pagination} from "antd-mobile";
import styles1 from '../../../assets/work/p1_b.jpg'
import styles2 from '../../../assets/work/p2_b.jpg'
const empty = require('is-empty');


const zuzhidata=[
  {
    title: '区建交委举行喜庆党的十九大演讲比赛',
    img:styles1
  },
{
    title: '我区开展"尊法守法  携手筑梦"fuw农民工法治宣传',
    img:styles2
  },
  {
    title: '全区广大干部群众认真学习宣传贯彻党的十九大精神',
    img:styles1
  },
  {
    title: '区建交委举行喜庆党的十九大演讲比赛',
    img:styles1
  },
  {
    title: '我区开展"尊法守法  携手筑梦"fuw农民工法治宣传',
    img:styles2
  },
  {
    title: '全区广大干部群众认真学习宣传贯彻党的十九大精神',
    img:styles1
  },
]

class life extends React.Component{
  constructor(props) {
    super(props);
    this.state = {
      carouselNumber1: 1,
      initialCarouselHeight1: '0rem',
      carouselNumber2: 1,
      initialCarouselHeight2: '0rem',
    };
  }

  //活动详情跳转
  hdparticulars = () =>{
    this.props.dispatch(
      routerRedux.push({
        pathname:"/work/life/lifeparticulars",
      })
    )
  };

  render() {

    return(
      <div>
        {
          zuzhidata.map((item,index) => {
            const number1 = index;
            return (
              <div style={{marginTop:'0.3rem',marginLeft:'0.4rem'}} onClick={this.hdparticulars}>
                <WhiteSpace size="lg"/>
                <div style={{width:'35%',display:'inline-block',verticalAlign:'middle'}}>
                  <img
                    src={item.img}
                    alt=""
                    style={{width: '100%',height: '2rem'}} />
                </div>

                <div style={{width:'60%',marginLeft:'3%',display:'inline-block',verticalAlign: 'middle'}}>
                <div>
                  {item.title}
                </div>
                <div style={{width: '100%',color: '#999',marginTop: '0.2rem',fontSize: '0.3rem'}}>
                  <span style={{marginRight: '0.5rem'}}>检测中心党支部</span>
                  <span>2017-11-10&nbsp;14:00</span>
                </div>
                </div>
              </div>
            )
          })
        }
      </div>
    )
  }
}


function mapStateToProps({ work }){
  return {
    work
  };
}
export default connect(mapStateToProps)(life);
